<%-- 
    Document   : listarPersona
    Created on : 06-jul-2011, 16:33:02
    Author     : rodrifonsi
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
        </head>
        <body>
            <h:form>
                <h1><h:outputText value="Listado de Personas"/></h1>
                <h:commandButton value="Nuevo" action="#{personaController.createSetup}"/>
                <h:dataTable value='#{personaController.listPersona}' var='item' border="1" headerClass="namesHeader" columnClasses="last,first">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="ID"/>
                        </f:facet>
                        <h:outputText value="#{item.id}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Nombre"/>
                        </f:facet>
                        <h:outputText value="#{item.nombre}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Rol"/>
                        </f:facet>
                        <h:outputText value="#{item.rolId.descripcion}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText escape="false" value="Acción"/>
                        </f:facet>
                        <h:commandLink  action="#{personaController.editSetup}">
                            <h:graphicImage  style="border:0" title="Editar" height="25" width="25" url="/iconos/edit.png"/>
                            <f:param name="idPersona" value="#{item.id}"/>
                        </h:commandLink>
                        <h:commandLink action="#{personaController.delete}" onclick="return confirm('Estas seguro?');" >
                            <h:graphicImage  style="border:0" title="Eliminar" height="25" width="25" url="/iconos/delete.png"/>
                            <f:param name="idPersona" value="#{item.id}"/>
                        </h:commandLink>
                    </h:column>
                </h:dataTable>
            </h:form>
        </body>
    </html>
</f:view>
